<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('打印请假记录')" />
    <style>
        .z1{font-size:13px;height: 35px;}
        td,th {border-width: 1px;border-style: solid;border-collapse: collapse; word-break: break-all; width: 250px; border-color: #333333;}
    </style>
</head>
<body class="white-bg">
<div class="btn-group-sm hidden-xs" style="margin-left: 20px" id="toolbar" role="group">
    <a class="btn btn-success" onclick="PreviewMytable()">
        <i class="fa fa-print"></i> 打印
    </a>
</div>
<div id="print_content">
    <table style="width: 100%;">
        <tr class="z1">
            <td>姓名</td>
            <td>[[${recordLeave.userName}]]</td>
            <td>身份证号</td>
            <td>[[${recordLeave.createBy}]]</td>
        </tr>
        <tr class="z1">
            <td>科室</td>
            <td>[[${recordLeave.deptName}]]</td>
            <td>职务</td>
            <td>[[${recordLeave.dutyName}]]</td>
        </tr>
        <tr class="z1">
            <td>指定职务代理人</td>
            <td>[[${recordLeave.agentUser}]]</td>
            <td>休假类型</td>
            <td>[[${@dict.getLabel('record_leave_type', recordLeave.leaveType)}]]</td>
        </tr>
        <tr class="z1">
            <td>请假事由</td>
            <td colspan="3">[[${recordLeave.leaveContent}]]</td>
        </tr>
        <tr class="z1">
            <td>休假日期</td>
            <td colspan="2">[[${#dates.format(recordLeave.startTime, 'yyyy-MM-dd')}]]至[[${#dates.format(recordLeave.endTime, 'yyyy-MM-dd')}]]</td>
            <td>共[[${recordLeave.days}]]天</td>
        </tr>
        <tr class="z1">
            <td>科室意见</td>
            <td>[[${recordLeave.chiefOpinion}]]</td>
            <td colspan="2">科室负责人签字：[[${recordLeave.chiefName}]]</td>
        </tr>
        <tr class="z1">
            <td>主管科室意见</td>
            <td>[[${recordLeave.manageOpinion}]]</td>
            <td colspan="2">主管科室负责人签字：[[${recordLeave.manageName}]]</td>
        </tr>
        <tr class="z1">
            <td>人事科意见</td>
            <td>[[${recordLeave.humanOpinion}]]</td>
            <td colspan="2">人事科负责人签字：[[${recordLeave.humanName}]]</td>
        </tr>
        <tr class="z1">
            <td>主管科室分管领导意见</td>
            <td>[[${recordLeave.leaderOpinion}]]</td>
            <td colspan="2">主管科室分管领导签字：[[${recordLeave.leaderName}]]</td>
        </tr>
        <tr class="z1">
            <td>行政领导意见</td>
            <td>[[${recordLeave.adminOpinion}]]</td>
            <td colspan="2">行政领导签字：[[${recordLeave.adminName}]]</td>
        </tr>
        <tr class="z1">
            <td>党委书记意见</td>
            <td>[[${recordLeave.partyOpinion}]]</td>
            <td colspan="2">党委书记签字：[[${recordLeave.partyName}]]</td>
        </tr>
        <tr style="height: 40px;">
            <td colspan="4" style="border: 0px; text-align: center; font-size: 12px; width: 100%;">注：休假及出差进修培训等不在岗情况均需填写，本表一式两份，由人事科及所在科室分别留存</td>
        </tr>
    </table>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: lodop-js" />
<script th:inline="javascript">
    var LODOP; //声明为全局变量

    var leaveId = [[${recordLeave.leaveId}]]

    function PreviewMytable() {
        $.ajax({
            type: "post",
            url: ctx + "record/leave/update",
            dataType: "json",
            data: {"leaveId" : leaveId}
        });

        LODOP = getLodop();

        LODOP.PRINT_INITA(0,0,522,333,"");
        LODOP.SET_PRINT_PAGESIZE(0,0,0,"A4");
        var strStyle="<style> .z1{font-size:13px;height: 35px;}td,th {border-width: 1px;border-style: solid;border-collapse: collapse; word-break: break-all; width: 250px; border-color: #333333;} </style>";
        LODOP.ADD_PRINT_TEXT("10mm","35mm","70mm","12mm","中层及以上干部请假审批表");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
        LODOP.SET_PRINT_STYLEA(0,"Bold",1);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.SET_PRINT_STYLEA(0,"Horient",3);
        LODOP.ADD_PRINT_TABLE("20mm","10mm","90%","45%",strStyle+document.getElementById("print_content").innerHTML);

        LODOP.ADD_PRINT_TEXT("150mm","35mm","70mm","12mm","中层及以上干部请假审批表");
        LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
        LODOP.SET_PRINT_STYLEA(0,"Bold",1);
        LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
        LODOP.SET_PRINT_STYLEA(0,"Horient",3);
        LODOP.ADD_PRINT_TABLE("160mm","10mm","90%","45%",strStyle+document.getElementById("print_content").innerHTML);

        LODOP.PREVIEW();
    }
</script>
</body>
</html>